<?php

/**
 * 商铺管理
 *
 * @author Alen
 * @since 1.0.0 2013-12-18
 */
class AC_Shop_EditAction extends PyramidACAction {
    //put your code here
    public function index(){
        $bizshop=new SoBizShop();
        $data=$bizshop->read_one($this->USER_NAME);
        $this->assign('data',$data);
        $this->assign('fileinput', get_file_input('Logo',$data['Logo']));
        $this->display();
    }
    
    public function save(){
        $bizshop=new SoBizShop();
        $logo=upload_file('Logo');
        $msg=$bizshop->update_shop($this->USER_NAME,request_string('ShopName'),request_string('Address'),request_string('Contact'),request_string('Telphone'),request_string('HomePage'),$logo,  request_string('AboutUs'));
	redirect($msg=='SUCCESS'?"编辑成功":$msg);
    }
}
